#include "stdafx.h"
#include "IPH.h"
void tisn::IPHelper::Get_IfTableMIB(std::vector<PMIB_IFROW> *rows)
{
	PMIB_IFTABLE pTable = { 0 };
	DWORD TableSize = 0;
	DWORD err = GetIfTable(NULL, &TableSize, false);
	if (err != ERROR_INSUFFICIENT_BUFFER)
	{
		return;
	}
	pTable = (MIB_IFTABLE *)malloc(TableSize);
	err = GetIfTable(pTable, &TableSize, false);
	if (err != NO_ERROR)
	{
		return;
	}
	PMIB_IFROW pRow;
	for (int i = 0; i < pTable->dwNumEntries; i++)
	{
		pRow = (PMIB_IFROW)& pTable->table[i];
		rows->push_back(pRow);
	}
}